﻿using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Request.Functions;
using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;

namespace MinimalistFoodStreet.BackEnd.Server.Server.RequestExtend.Functions
{
    public static class RequestCommentsAddDtoExtend
    {
        public static Comment toEntity(this RequestCommentsAddDto dto, int accountId)
        {
            return new Comment
            {
                CAccountId = accountId,
                CCommentId = dto.commentId,
                CMainCommentId = dto.mainCommentId,
                COrderDetailId = dto.orderDetailId,
                CGoodId = dto.goodId,
                CRate = dto.rate,
                CContent = dto.content,
            };
        }
    }
}
